<template>
    <view class="content">

    </view>
</template>

<script>
    import api from '@/api/api.js';
    export default {
        onShow() {

            if (!this.utils.checkLoginState()) {
                console.log(1111);
                setTimeout(() => {
                    uni.reLaunch({
                        url: '/pages/common/login',
                        animationType: 'pop-in',
                        animationDuration: 100
                    })
                }, 200);
            } else {
                console.log(2222);
                uni.reLaunch({
                    url: '/pages/index/index',
                    animationType: 'pop-in',
                    animationDuration: 100
                })
            }
        },
    };
    //接口请求
    //https://www.cnblogs.com/caitangbutian/p/12937289.html
    //https://blog.csdn.net/weixin_44763569/article/details/107267124
</script>

.content {
height: 100%;
width: 100%;
position: relative;
padding-top: 0;
}
<style>
</style>